import request from '@/utils/request'
import {
  renderUrl
} from '../utils'

const headers = {
  'Content-Type': 'application/json'
}

export function add(data) {
  return request({
    url: '/admin/productCategory/add',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function edit(data) {
  return request({
    url: '/admin/productCategory/update',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function del(data) {
  return request({
    url: '/admin/productCategory/delById',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function getProductCategory(data) {
  return request({
    url: '/admin/productCategory/list',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function getProductCategoryTwo(data) {
  return request({
    url: '/admin/productCategory/querytwo',
    method: 'post',
    data: JSON.stringify(data),
    headers,
    extraConfig: { loading: false }
  })
}
export function getProductCatenavigation(data) {
  return request({
    url: '/admin/productCategory/update/navigation',
    method: 'post',
    data: JSON.stringify(data),
    headers,
    extraConfig: { loading: false }
  })
}

export default {
  edit,
  add,
  del
}
